//购物车相关接口
import http from '@/utils/http'

//购物车列表
export const reqCartList = ()=>{
  return http.get('/cartList')
}
//加入购物车
export const reqAddCartGoods = (data) =>{
  return http.post(`/cartList`,data)
}
//更新商品的选中状态  mock模拟所有把对象整个传入,正常传入要修改的值就可以
export const reqUpdateChecked = (id,data)=>{
  return http.put(`/cartList/${id}`,data)
}
//全选和全不选
export const reqCheckedAll = (data)=>{
  return http.put(`/cartList`,data)
}

//删除购物车商品   正常是商品id因为是mock故用id
export const reqDelCartGoods = (id)=>{
  return http.delete(`/cartList/${id}`)
}
